export function filterTree(data, field, value) {
  return data.filter((item) => {
    if (item[field] && item[field].includes(value)) {
      return true;
    }
    if (item.children) {
      item.children = filterTree(item.children, field, value);
      return item.children.length > 0;
    }
    return false;
  });
}
